From d45d604df1c1fec9334162f796ef5d8623dd4f45 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 6 Feb 2020 17:14:44 +0100 Subject: [PATCH] Remove gtk_icon_paintable_download_texture() public API This allows us do do what we want internally, and anyway it didn't really do what you'd expect anymore now that we do resizing during rendering. --- docs/reference/gtk/gtk4-sections.txt | 1 - gtk/gtkicontheme.c | 17 ++++------------- gtk/gtkicontheme.h | 2 -- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index c59c2e6692..fa4001a1f6 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -5011,7 +5011,6 @@ gtk_icon_theme_list_icons gtk_icon_theme_get_icon_sizes gtk_icon_paintable_get_filename gtk_icon_paintable_is_symbolic -gtk_icon_paintable_download_texture GtkIconClass GTK_ICON_THEME diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 9b356b4e9b..2b94a87339 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -2072,8 +2072,7 @@ choose_icon (GtkIconTheme *self, * * Looks up a named icon for a desired size and window scale, returning a * #GtkIcon. The icon can then be rendered by using it as a #GdkPaintable, - * or you can get information such as the filename and size. The pixels - * of the texture can be access by using gtk_icon_paintable_download_texture(). + * or you can get information such as the filename and size. * * If the available @icon_name is not available and @fallbacks are provided, * they will be tried in order. @@ -3301,16 +3300,8 @@ icon_ensure_texture__locked (GtkIconPaintable *icon, } } -/** - * gtk_icon_paintable_download_texture: - * @self: a #GtkIcon - * - * Tries to access the pixels of an icon. - * - * Returns: (transfer full): An texture with the contents of the icon. - */ -GdkTexture * -gtk_icon_paintable_download_texture (GtkIconPaintable *self) +static GdkTexture * +gtk_icon_paintable_ensure_texture (GtkIconPaintable *self) { GdkTexture *texture = NULL; @@ -3401,7 +3392,7 @@ gtk_icon_paintable_snapshot_with_colors (GtkIconPaintable *icon, double render_height; gboolean symbolic; - texture = gtk_icon_paintable_download_texture (icon); + texture = gtk_icon_paintable_ensure_texture (icon); symbolic = gtk_icon_paintable_is_symbolic (icon); if (symbolic) diff --git a/gtk/gtkicontheme.h b/gtk/gtkicontheme.h index a780dc14a8..efacc13c50 100644 --- a/gtk/gtkicontheme.h +++ b/gtk/gtkicontheme.h @@ -140,8 +140,6 @@ GDK_AVAILABLE_IN_ALL const gchar * gtk_icon_paintable_get_filename (GtkIconPaintable *self); GDK_AVAILABLE_IN_ALL gboolean gtk_icon_paintable_is_symbolic (GtkIconPaintable *self); -GDK_AVAILABLE_IN_ALL -GdkTexture * gtk_icon_paintable_download_texture (GtkIconPaintable *self); G_END_DECLS -- 2.30.2